﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MazeStarter
{
    public partial class MazeStarterForm : Form
    {
        public MazeStarterForm()
        {
            InitializeComponent();

            this.playerCombo.Text = Environment.UserName;
            this.highScoreView.ListViewItemSorter = new Maze.HighScoreComparer();
        }

        private void quitButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void startButton_Click(object sender, EventArgs e)
        {
            Maze.MazeForm form = new Maze.MazeForm(Maze.Level.Create());
            form.ShowDialog(this);

            Maze.HighScoreItem item = new Maze.HighScoreItem(this.playerCombo.Text, form.Score);
            this.highScoreView.Items.Add(item);
        }
    }
}
